'use strict';

var _betterScroll = require('better-scroll');

var _betterScroll2 = _interopRequireDefault(_betterScroll);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

window._BScroll = _betterScroll2.default;

(function () {
    var template = function template(self) {
        return '<aux-view content>' + self.innerHTML + '</aux-view>';
    };

    document.auiDefineElement('aum-scroll', {
        template: template,
        created: function created(self) {
            self.$ele.content = self.children[0];
            self.$ele.content.auiAddOnceClass("wheel-scroll");
        },
        attached: function attached(self) {
            self.$control = new _BScroll(self, {
                wheel: {
                    selectedIndex: 0,
                    /** 默认值就是下面配置的两个，为了展示二者的作用，这里再配置一下 */
                    wheelWrapperClass: 'wheel-scroll',
                    wheelItemClass: 'wheel-item'
                }
            });
        }
    });
})();